package com.angel.util;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import android.content.Context;
import android.widget.SimpleAdapter;
import com.angel.activity.R;

public class AdapterUtil {
	/*创建菜单GridView适配器*/
	public static  SimpleAdapter setMenuAdapter(int[] img,String[] text,Context context,int[] count) {
		List<Map<String,Object>> list=new ArrayList<Map<String,Object>>();
		
		for(int i=0;i<count.length;i++){
			   Map<String,Object> map=new HashMap<String,Object>();
			        map.put("Img", img[i]);
			        map.put("Text",text[i]);
			        list.add(map);
		}
		SimpleAdapter adapter=new SimpleAdapter(context, list, R.layout.item_menu,new String[]{"Img","Text"},new int[]{R.id.menu_image,R.id.menu_text});
		return adapter;
	  }
}
